package main

import "fmt"

// 枚举

// 用自定义类型来实现用途明确的枚举类型
type color byte

const (
	black = iota
	red
	blue
)

func test(c color) {
	println(c)
}

func main() {
	test(red)

	const m = 100
	fmt.Printf("%T,%v\n", m, m)
	test(m)

	// const n int = 100
	// test(n) // cannot use n (constant 100 of type int) as color value

	// x := 2
	// test(x) // cannot use x (variable of type int) as color value
}
